﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI.WebControls;
using System.Web.UI;

namespace TallComponents.Web.Pdf
{
   internal class CssStyle : Style
   {
      public CssStyle()
      {
         StyleAttributes = new Dictionary<string, string>();
      }

      protected override void FillStyleAttributes( CssStyleCollection attributes, IUrlResolutionService urlResolver )
      {
         base.FillStyleAttributes( attributes, urlResolver );
         foreach ( KeyValuePair<string, string> pair in StyleAttributes )
         {
            // This will overwrite existing values
            attributes.Add( pair.Key, pair.Value );
         }
      }

      public void Add( string key, string value )
      {
         StyleAttributes.Add( key, value );
      }

      public IDictionary<string,string> StyleAttributes
      {
         get;
         private set;
      }
   }
}
